import Login from "@/views/Login.vue";
import AdminPage from "@/views/AdminPage.vue";
import IndexPage from "@/views/IndexPage.vue";
import Home from "@/views/adminpage/Home.vue";
import Settings from "@/views/adminpage/Settings.vue";
import Workspace from "@/views/adminpage/Workspace.vue";
import userInfo from '@/views/userInfo/userInfo.vue'
const platformRouter = [
  {
    path: "",
    redirect: "/admin",
  },
  {
    path: "/login",
    name: "login",
    component: Login,
    meta: {
      requiresAuth: true,
      key: "登录",
    },
  },
  {
    path: "/admin",
    component: AdminPage,
    redirect: "/admin/workspace",
    children: [
      {
        path: "home",
        name: "adminHome",
        component: Home,
        meta: { requiresAuth: true, key: "管理员-首页" },
      },
      {
        path: "workspace",
        name: "adminWorkspaces",
        component: Workspace,
        meta: { requiresAuth: true, key: "管理员-工作台" },
      },
      {
        path: "settings",
        name: "adminSettings",
        component: Settings,
        meta: { requiresAuth: true, key: "管理员-系统设置" },
        redirect: "/admin/settings/account",
        children: [
          {
            path: "notice",
            name: "Notice",
            component: () => import("@/views/adminset/Notice.vue"),
            meta: { requiresAuth: true, key: "公告" },
          },
          {
            path: "account",
            name: "Account",
            component: () => import("@/views/adminset/Account.vue"),
            meta: { requiresAuth: true, key: "账号管理" },
          },
          {
            path: "log",
            name: "Log",
            component: () => import("@/views/adminset/Log.vue"),
            meta: { requiresAuth: true, key: "系统日志" },
          },
          {
            path: "watermark",
            name: "Watermark",
            component: () => import("@/views/adminset/Watermark.vue"),
            meta: { requiresAuth: true, key: "水印设置" },
          }
        ],
      },
    ],
  },
  {
    path: "/home",
    component: IndexPage,
    children: [],
  },
  {
    path:"/userInfo/userInfo",
    component: userInfo,
    children: [],
    meta: { requiresAuth: true, key: "个人资料",disableTabRedirect: true },
  }
 
];

export default platformRouter;
